import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { patientConsultOrderReq } from '@/types/consult'
export const useConsultStore = defineStore(
  'consult',
  () => {
    const consultInfo = ref<patientConsultOrderReq>()
    const setConsultInfo = (item: patientConsultOrderReq) => {
      consultInfo.value = item
    }
    // 存储患者id
    const setPatientId = (id: string) => {
      consultInfo.value!.patientId = id
    }

    return { consultInfo, setConsultInfo, setPatientId }
  },
  {
    persist: {
      paths: ['consultInfo']
    }
  }
)
